<?php

/**
 * @author Sanches
 * @copyright 2008
 */
 
include "in.php";

if (isset($_REQUEST['DEBUG']))
{
	$BS['ADM']['debug']=$_REQUEST['DEBUG'];
}

if (isset($_REQUEST['login']))
{
	if (($_REQUEST['usr']===$BS['ADM']['login']) and ($_REQUEST['pas']===$BS['ADM']['pass']))
	{
		
		$_SESSION['act']=1;
		$_SESSION['h']=sha1($_REQUEST['usr'].$_REQUEST['pas']);	
		$_SESSION['hu']=md5($_REQUEST['usr']);	
		$_SESSION['hp']=md5($_REQUEST['pas']);
		
	}
	else
	{
		unset ($_SESSION['act']);
		unset ($_SESSION['h']);
		unset ($_SESSION['hu']);
		unset ($_SESSION['hp']);
	}

}

if (isset($_REQUEST['logout']))
{
		unset ($_SESSION['act']);
		unset ($_SESSION['h']);
		unset ($_SESSION['hu']);
		unset ($_SESSION['hp']);
}
include "footer.php";

?>